package cn.edu.scnu.semart.model.order;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;


@Data
@TableName("`order`") // 注意：order 是 SQL 关键字，需加反引号
public class Order {
    @TableId(value = "order_id", type = IdType.AUTO)
    private Integer orderId;

    @TableField("order_number")
    private String orderNumber;

    @TableField("user_id")
    private Integer userId;

    @TableField("total_price")
    private BigDecimal totalPrice;

    @TableField("address_id")
    private Integer addressId;

    @TableField("status")
    private String status;// pending_payment, pending_delivery, pending_receipt, completed, canceled

    @TableField("create_time")
    private Date createTime;

    @TableField("payment_time")
    private Date paymentTime;

    @TableField("pay_trade_no")
    private String payTradeNo; // 支付单号（out_trade_no）

    // 数据库中不存在的字段，标记为不存在
    @TableField(exist = false)
    private Date deliveryTime;

    @TableField(exist = false)
    private Date completeTime;
}